<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [];
        arr.length = prompt('请输入要计算几个数?');
        for (i = 0; i < arr.length; i++) {
            arr[i] = prompt('请输入' + (i + 1) + '个数字') - 0;
        }
        console.log(arr);
        var maxNum = 0
        function getMaxOne(arrMaxOne) {
            for (i = 0; i < arrMaxOne.length; i++) {
                if (arrMaxOne[i] >= maxNum) {
                    maxNum = arrMaxOne[i];
                }
            }
            return maxNum;
        }
        alert(getMaxOne(arr))

    </script>
</head>

<body>

</body>

</html>